package cn.mw.cmdb.entity;

import cn.mw.cmdb.service.ServiceChoose;
import cn.mw.cmdb.service.impl.InstanceServiceImpl;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serial;

@Data
@Document("mw_cmdbmd_config")
public class MwCMDBConfigInfo implements ServiceChoose {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "Id")
    @CMDBProperty(searchType = PropertyTypeString.ID, searchPrefix = "_", isShow = true)
    @AutoId
    private String id;

    @Indexed
    @Schema(description = "配置项名称")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private String configName;

    @Schema(description = "配置项Key")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private String configKey;

    @Schema(description = "配置项Value")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private Object configValue;

    @Override
    public String getServiceId() {
        return InstanceServiceImpl.ID;
    }
}
